package core.api;

import java.rmi.RemoteException;

public interface ClientAPI extends CommunAPI {

	/**
	 * Signal timeout from a destination
	 * @param dest
	 * @throws RemoteException
	 */
	void timeout(int dest) throws RemoteException ;
	
	/**
	 * Signal timeout from a destination
	 * When used by the protocol
	 * @param dest
	 * @throws RemoteException
	 */
	void timeoutProtocol(int dest) throws RemoteException ;
	
	/**
	 * Invoke protocol function
	 * @param source
	 * @param dest
	 * @param method
	 * @param objects
	 * @throws RemoteException
	 */
	void invokeProtocol(int source, int dest, String method, Object ... objects) throws RemoteException ;
	
	/**
	 * Get unique id of the client
	 * @return
	 */
	public int getId() throws RemoteException;
	
	/**
	 * Set unique id of the client
	 * @param id
	 */
	public void setId(final int id) throws RemoteException;
	
	/**
	 * Send new client id
	 * @param iId
	 */
	public void addClient(int iId) throws RemoteException;


}
